﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Pariveda.ObjectDataSource.Business
{
    public class CategoryController
    {
        /// <summary>
        /// Retrieves a list of id 
        /// </summary>
        /// <returns></returns>
        public List<KeyValuePair<int, string>> GetList()
        {
            using (NorthwindDataContext db = new NorthwindDataContext())
            {
                var categoryQuery = from c in db.Categories
                                    orderby c.CategoryName
                                    select new KeyValuePair<int, string>(c.CategoryID, c.CategoryName);
                return categoryQuery.ToList();
            }
        }
    }
}
